package edu.study.common.retry;

public class RetryPolicyFactory {
    
    public static RetryPolicy getInstance(String policy) {
        RetryPolicyEnum retryPolicyEnum = RetryPolicyEnum.parseCode(policy);

        if (retryPolicyEnum == RetryPolicyEnum.SAME_INTERVAL) {
            return new SameIntervalPolicy();
        } else if (retryPolicyEnum == RetryPolicyEnum.POW) {
            return new PowPolicy();
        }

        return null;
    }
}
